package com.yuyue.dronesystem.configs;

import java.util.Arrays;

import com.yuyue.dronesystem.server.CSSFilter;

import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MyServerConfig
 */
// public class MyServerConfig implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {

// @Configuration
public class MyServerConfig{

    // @Bean
    public FilterRegistrationBean<CSSFilter> myfilter() {
        FilterRegistrationBean<CSSFilter> registrationbean = new FilterRegistrationBean<>();
        registrationbean.setFilter(new CSSFilter());
        registrationbean.setUrlPatterns(Arrays.asList("*.css"));
        return registrationbean;
    }
}